package com.bkgy.controller.acidefficiency.controller;

import com.bkgy.controller.acidefficiency.entity.TbTcm22280Eff;
import com.bkgy.controller.acidefficiency.entity.pdo.UseRate;
import com.bkgy.controller.acidefficiency.service.ITbTcm22280EffService;
import com.bkgy.sys.common.entity.ResultData;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "2280酸轧效率分析表", description = "2280酸轧效率分析表")
@RestController
@RequestMapping("/tcmEff")
@RequiredArgsConstructor
public class TbTcm22280EffController {
    private final ITbTcm22280EffService service;

    @Operation(summary = "查询酸轧开卷所处步骤", description = "查询酸轧开卷所处步骤")
    @GetMapping("/selectStep")
    public ResultData<TbTcm22280Eff> selectStep(String entId) {
        if(StringUtils.isEmpty(entId)){
            return ResultData.ResultDataFaultSelf("入口卷号不能为空",null);
        }
        return service.selectStep(entId);
    }

    @Operation(summary = "投用率计算", description = "投用率计算")
    @GetMapping("/useRate")
    public ResultData<UseRate> useRate() {
        return service.useRate();
    }
}
